<?php
	require_once 'common.php';

	// Retrieve array of friends who've already added the app.
	$user=$fb_user_id;
	$fql = 'SELECT uid, name FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1='.$user.') AND has_added_app = 1';
	$friends = $facebook->api_client->fql_query($fql);




	echo "<form name='myform' action='http://apps.facebook.com/bundundu/save_share.php' method='post'>";

	$i=0;
	foreach($friends as $friend)
	{
		echo "<input type='checkbox' name=friends[] value='".$friend['uid'] . "'/>" . $friend['name'] . "<br/>";
	}

	echo "<input type='submit' value='submit'/>";
	echo "</form>";

?>
